jconed.toolbar.register_handler ( 'Html', function ( editor )
{
	var tpl = '<div id="jconed-html-textarea-container"><textarea id="jconed-html-textarea">%s</textarea></div>' +
		'<div class="jconed-html-buttons">' +
		'<button class="jconed-html-button grey" onclick="jconed.__clean_ms()">MS Word to HTML</button>' +
		'<button class="jconed-html-button green" onclick="jconed.__html_confirm()">Conferma</button>' +
		'<button class="jconed-html-button yellow" onclick="jconed.__html_abort()">Annulla</button>' +
		'</div>';

	liwe.lightbox.easy ( 'jconed-html-dialog', 'HTML', 'auto', 'auto' );

	$( 'jconed-html-dialog', String.format ( tpl, jconed.editor.current.get_value () ) );
	liwe.dom.add_class ( $( 'jconed-html-dialog' ), 'frm' );
} );

jconed.__clean_ms = function ()
{
	var tmp_txt = $v( 'jconed-html-textarea' );
	$( 'jconed-html-textarea' , liwe.utils.word2html ( tmp_txt ) );
};

jconed.__html_confirm = function ()
{
	jconed.editor.current.set_value ( $v ( 'jconed-html-textarea' ) );
	liwe.lightbox.close ();
};

jconed.__html_abort = function ()
{
	liwe.lightbox.close ();
};
